#include<stdio.h>
int main()
{
	int n;
	scanf("%d",&n);
	int i;
	int flag=0;
	int jiou;
	int count=0;
	for(i=1;i<=n;i++){
		int x=i;
		int wei;
		jiou=1;
		//x=x/10;
		count++;
		while(x>0){
			wei=x%10;
			x=x/10;
			
			if(jiou==1){
			jiou=0;
			//printf("%d\n",wei);
			if(wei%2==0){
				//printf("!!!");
				count--;
				break;
			}
		}
		else{
			jiou=1;
			if(wei%2!=0){
				count--;
				break;
			}
		}
		}
	}
	printf("%d",count);
	return 0;
}
